package com.dh.exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;

public class ExceptionDemo05 {
    public static void main(String[] args) throws IOException {

        show(null);

    }

    public static void test() throws IOException {
        show(null);
    }

    public static void show(String content)  {
        FileInputStream fileInputStream = null;
        try {
            fileInputStream = new FileInputStream("C:\\Users\\Administrator\\Desktop\\2.txt");
            fileInputStream.read();
        } catch (FileNotFoundException e) {
            System.out.println("呵呵");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            System.out.println("哈哈");
            if(fileInputStream != null){
                try {
                    fileInputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }


}
